Skip to content

Add PEP 800 (disjoint bases)#2262

Merged
JelleZijlstra merged 1 commit intopython:mainfrom
JelleZijlstra:pep800
Apr 17, 2026
Merged

Add PEP 800 (disjoint bases)#2262
JelleZijlstra merged 1 commit intopython:mainfrom
JelleZijlstra:pep800

Conversation

@JelleZijlstra
Copy link
Copy Markdown
Member

Line 123: Expected 1 errors
"""
output = """
directives_disjoint_base.py:69:7: error[instance-layout-conflict] Class will raise `TypeError` at runtime due to incompatible bases: Bases `Left` and `Right` cannot be combined in multiple inheritance
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, this error is actually inaccurate; there's no runtime error if the class is just marked with @disjoint_base at runtime.

Copy link
Copy Markdown
Member

@carljm carljm Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the error is correct for the intended use of disjoint_base, though. I'm not sure it would be preferable to adjust the error message to account for misuse on classes that aren't actually disjoint bases.

@srittau srittau added topic: typing spec For improving the typing spec topic: conformance tests Issues with the conformance test suite labels Apr 16, 2026
@JelleZijlstra JelleZijlstra merged commit 322fb10 into python:main Apr 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: conformance tests Issues with the conformance test suite topic: typing spec For improving the typing spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants